// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Fluent;
using Elastic.Clients.Elasticsearch.Requests;
using Elastic.Clients.Elasticsearch.Serialization;
using Elastic.Transport;
using Elastic.Transport.Extensions;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.Cluster;

public sealed partial class PostVotingConfigExclusionsRequestParameters : RequestParameters
{
	/// <summary>
	/// <para>
	/// A comma-separated list of the persistent ids of the nodes to exclude
	/// from the voting configuration. If specified, you may not also specify node_names.
	/// </para>
	/// </summary>
	public Elastic.Clients.Elasticsearch.Ids? NodeIds { get => Q<Elastic.Clients.Elasticsearch.Ids?>("node_ids"); set => Q("node_ids", value); }

	/// <summary>
	/// <para>
	/// A comma-separated list of the names of the nodes to exclude from the
	/// voting configuration. If specified, you may not also specify node_ids.
	/// </para>
	/// </summary>
	public Elastic.Clients.Elasticsearch.Names? NodeNames { get => Q<Elastic.Clients.Elasticsearch.Names?>("node_names"); set => Q("node_names", value); }

	/// <summary>
	/// <para>
	/// When adding a voting configuration exclusion, the API waits for the
	/// specified nodes to be excluded from the voting configuration before
	/// returning. If the timeout expires before the appropriate condition
	/// is satisfied, the request fails and returns an error.
	/// </para>
	/// </summary>
	public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q<Elastic.Clients.Elasticsearch.Duration?>("timeout"); set => Q("timeout", value); }
}

/// <summary>
/// <para>
/// Updates the cluster voting config exclusions by node ids or node names.
/// </para>
/// </summary>
public sealed partial class PostVotingConfigExclusionsRequest : PlainRequest<PostVotingConfigExclusionsRequestParameters>
{
	internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterPostVotingConfigExclusions;

	protected override HttpMethod StaticHttpMethod => HttpMethod.POST;

	internal override bool SupportsBody => false;

	internal override string OperationName => "cluster.post_voting_config_exclusions";

	/// <summary>
	/// <para>
	/// A comma-separated list of the persistent ids of the nodes to exclude
	/// from the voting configuration. If specified, you may not also specify node_names.
	/// </para>
	/// </summary>
	[JsonIgnore]
	public Elastic.Clients.Elasticsearch.Ids? NodeIds { get => Q<Elastic.Clients.Elasticsearch.Ids?>("node_ids"); set => Q("node_ids", value); }

	/// <summary>
	/// <para>
	/// A comma-separated list of the names of the nodes to exclude from the
	/// voting configuration. If specified, you may not also specify node_ids.
	/// </para>
	/// </summary>
	[JsonIgnore]
	public Elastic.Clients.Elasticsearch.Names? NodeNames { get => Q<Elastic.Clients.Elasticsearch.Names?>("node_names"); set => Q("node_names", value); }

	/// <summary>
	/// <para>
	/// When adding a voting configuration exclusion, the API waits for the
	/// specified nodes to be excluded from the voting configuration before
	/// returning. If the timeout expires before the appropriate condition
	/// is satisfied, the request fails and returns an error.
	/// </para>
	/// </summary>
	[JsonIgnore]
	public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q<Elastic.Clients.Elasticsearch.Duration?>("timeout"); set => Q("timeout", value); }
}

/// <summary>
/// <para>
/// Updates the cluster voting config exclusions by node ids or node names.
/// </para>
/// </summary>
public sealed partial class PostVotingConfigExclusionsRequestDescriptor : RequestDescriptor<PostVotingConfigExclusionsRequestDescriptor, PostVotingConfigExclusionsRequestParameters>
{
	internal PostVotingConfigExclusionsRequestDescriptor(Action<PostVotingConfigExclusionsRequestDescriptor> configure) => configure.Invoke(this);

	public PostVotingConfigExclusionsRequestDescriptor()
	{
	}

	internal override ApiUrls ApiUrls => ApiUrlLookup.ClusterPostVotingConfigExclusions;

	protected override HttpMethod StaticHttpMethod => HttpMethod.POST;

	internal override bool SupportsBody => false;

	internal override string OperationName => "cluster.post_voting_config_exclusions";

	public PostVotingConfigExclusionsRequestDescriptor NodeIds(Elastic.Clients.Elasticsearch.Ids? nodeIds) => Qs("node_ids", nodeIds);
	public PostVotingConfigExclusionsRequestDescriptor NodeNames(Elastic.Clients.Elasticsearch.Names? nodeNames) => Qs("node_names", nodeNames);
	public PostVotingConfigExclusionsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? timeout) => Qs("timeout", timeout);

	protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
	{
	}
}